export const videoEvents = {
  switchEpisode: (url: string, name: string, index?: number) => {
    if (!url) {
      console.error('视频URL为空，无法切换');
      return false;
    }
    
    console.log('派发切换选集事件:', url, name, index);
    
    const event = new CustomEvent('switchEpisode', { 
      detail: { 
        url, 
        name,
        index 
      },
      bubbles: true,
      cancelable: true
    });
    
    return window.dispatchEvent(event);
  }
}; 